package genhandle

// 生成main文件
import (
	"fginTpl/fgin_grpc_gen/config"
	"fginTpl/fgin_grpc_gen/globals"
	"fginTpl/utils"
	"path/filepath"
)

func GenMain() {
	tplParams := map[string]string{
		"ProjectName": config.ConfigData.ProjectName,
		"Port":        config.ConfigData.Port,
		"PrjPascal":   utils.SnakeToPascal(config.ConfigData.ProjectName),
	}
	if err := utils.TourchFile(filepath.Join(globals.BASEDIR, "./main.go"), "./fgin_grpc_templates/main.tpl", "ginMainTpl", tplParams); err != nil {
		panic(err)
	}
}
